(function(window, undefined){

var document = window.document,
	navigator = window.navigator,
	location = window.location;
var Done = (function(){

	var Done = function( selector, context ) {
		return new Done.fn.init( selector, context);
	},
	
	_Done = window.Done,
	
	_D = window.D,
	
	// Useragent RegExp
	rwebkit = /(webkit)[ \/]([\w.]+)/,
	ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
	rmsie = /(msie) ([\w.]+)/,
	rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
	
	userAgent = navigator.userAgent,
	//匹配浏览器引擎以及版本
	browserMatch,
	
	// Save a reference to some core methods
	toString = Object.prototype.toString,
	hasOwn = Object.prototype.hasOwnProperty,
	push = Array.prototype.push,
	slice = Array.prototype.slice,
	trim = String.prototype.trim,
	indexOf = Array.prototype.indexOf;
	
	
	Done.fn = Done.prototype = {
		init : function ( selector , context) {
			
		}
	} 
	
	return Done;
})();

 /*
 *计算字符串长度 （一个中文字符算两个字节）
 *@str 字符串
 */ 

 function stringLength(str) {
        var len =0;
        for(var i=0, l = str.length ; i<l; i++) {
             len = len +(str.charCodeAt(i)>256 ? 2 : 1);
        }
        return len;
 }
 /*
 *背景闪烁
 *@el 元素的 Done 对象 
 *@max 闪烁次数
 */ 
 function notice(el, max, color) {      
          var i=0;
          (function(){
              var f = arguments.callee;
             if(i<=max) setTimeout(function(){
                  el.css('background-color',i++%2 == 0 ? color: '');
                  f();
              },100);
          })();
  }

})